﻿using System;
using MaLu.Common;
using System.Data;
using MaLu.BusiLogic;

namespace MaluJg.web.Stats02.financial
{
    public partial class FBooth : BasicPage
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {
                BindData();

            }

        }
        private void BindData()
        {
            DataSet ds = BLFarm.SumBooth(Provider, Year, VillageID);

            if (VillageID == 0)
            {

                divSingle.Visible = false;
                ltlHeader.Text = "葡萄合作社社员租用马陆葡萄交易市场摊位租金补贴汇总表";
                rpWhole.DataSource = ds.Tables[1];
                rpWhole.DataBind();

            }
            else
            {
                divWhole.Visible = false;

                if (ds.Tables[0].Rows.Count > 0)
                {
                    ltlHeader.Text = ds.Tables[0].Rows[0][0].ToString() + "葡萄合作社社员租用马陆葡萄交易市场摊位租金补贴清单";



                    rpSingle.DataSource = ds.Tables[1];
                    rpSingle.DataBind();
                }

            }
            Title = ltlHeader.Text;
            if (ds.Tables[2].Rows.Count > 0)
            {
                DataRow drsum = ds.Tables[2].Rows[0];
                sum7.Text = sum1.Text = drsum["sum1"].ToString();
                sum8.Text = sum2.Text = drsum["sum2"].ToString();
                if (ds.Tables[2].Columns.Contains("sum3"))
                    sum9.Text = drsum["sum3"].ToString();

            }
        }
    }
}
